Read Me About NoCopyReceives for CodeWarrior 
(ProjectBuilder is below)

2.0

This sample demonstrates the use of no-copy receives under Open Transport.  The code from this sample is featured in the book Inside Macintosh: Open Transport.

Packing List

The package contains the following items items: 

 NoCopyReceives.mcp  A project to build the PPC version. 
 NoCopyReceives(Carbon)  A compiled version of the above.
 NoCopyReceives.c  Source code common to both projects.
 NoCopyReceives_Output.txt  Source code common tobothh projects.


Sample Requirements

I tested this code with Carbon 1.2.5 running under Mac OS 9 and on Mac OSX.  The code should run just fine with Carbon 1.2.5 (or newer) and Universal Interfaces 3.3.2 (or newer).  

Running the Sample

To run the sample, simply double click the application and read the output on the console window.  The sample will connect via HTTP to www.apple.com and download the root page twice, illustrating two different ways of using OTs no-copy receive functionality.  The sample places both copies of the page (with HTTP headers) into the file NoCopyReceives_Output.txt in the same folder as the application.  You can open this file with a text editor to check that the page was downloaded successfully.

Building the Sample

The sample was built using the Metrowerks CodeWarrior IDE 4.1 environment Carbon SDK 1.2.5 and Universal Interfaces 3.3.2.  Both the Carbon SDK and Universal intefaces can be downloaded from Apple website at : http://developer.apple.com/sdk/index.html

To rebuild the sample, first open the project and change the Access Paths to point to the interfaces and libraries from the Carbon 1.2.5 SDK (or newer) and the Universal Interfaces 3.3.2 (or newer).  Then choose Make from the Project menu.

Credits and Version History

If you find any problems with this sample, mail <DevSupport@apple.com> with Attn: Quinn as the first line of your mail and Ill try to fix them up.

Version 1.0d1 (Sep 1997) is the first release.

Version 1.0d2 (Jul 1998) fixes a serious bug in the use of OTReadBuffer.  OTReadBuffer modifies info->fBuffer, so you cant use that as your only copy of the OTBuffer pointer.  You must have an extra copy of the original value that you pass to OTReleaseBuffer.

Version 2.0 (March 2001) Carbonized the sample.

Share and Enjoy

Quinn The Eskimo!
Apple Developer Technical Support
Networking, Communications, Hardware

2 March 2001.

==========

Read Me About NoCopyReceives For ProjectBuilder

2.0

This sample demonstrates the use of no-copy receives under Open Transport.  The code from this sample is featured in the book Inside Macintosh: Open Transport.

Packing List

The package contains the following items items: 

 NoCopyReceives.pbproj  Project Builder Project.
 build/NoCopyReceives  The runnable sample code for OSX. 
 main.c  Source code to the project.

Sample Requirements

I tested this code with CoreServices under OSX and with CarbonLib 1.3 under OS9.  

Running the Sample

To run the sample, simply double click the application 'build/NoCopyReceives' and follow the onscreen instructions.  Or you can run it at the command line using the terminal application..

Building the Sample

The sample was built using ProjectBuilder which is included in developer package with OSX. 

To rebuild the sample, first open the project.  Then choose Make from the Project menu.

Credits and Version History
 
If you find any problems with this sample, mail <DevSupport@apple.com> with Attn: Quinn as the first line of your mail and Ill try to fix them up.

Chad Jones
Happy Coding
Feb 16, 2001
